package com.itheima.a01mycollection;

import java.util.ArrayList;
import java.util.Collection;

public class A02_CollectionDemo2 {
    public static void main(String[] args) {
        Collection<Student> coll= new ArrayList<Student>();

        Student s1 = new Student(1,"qq",19);
        Student s2 = new Student(2,"ww",20);
        Student s3 = new Student(3,"ee",20);

        coll.add(s1);
        coll.add(s2);
        coll.add(s3);

        Student s4 = new Student(1,"qq",19);


        //判断是否存在时,底层用的是s4这个参数对象里面的equals方法，
        //比较的是地址值，想比较内容需要在s4的javabean里面重写
        System.out.println(coll.contains(s4));

    }
}
